﻿<?php 

require '../../frame/base.php';

$cateId = !empty($_REQUEST['cateId'])?$_REQUEST['cateId']:null;

// 分页
if($_REQUEST['page']!="" && $_REQUEST['pagesize']!=""){
	$de=$_REQUEST['page']*$_REQUEST['pagesize'];
	$size=$_REQUEST['pagesize'];
}else{
	$de=0;
	$size=20;
}
// 分页 end

if($cateId){
	$storAry = $Db->table('goods')->field('goodsid,title,images,price,yuanjia,xiaoliang,addtime')->where('leimu',$cateId)->where('shangjia','<>','0')->limit($de,$size)->select();
	$ary = array('code'=>200,'msg'=>'成功','data'=>$storAry);
}else{
	$ary = array('code'=>100,'msg'=>'失败');
}
echo json_encode($ary);